package com.knowledge.plus.设计模式.建造者模式;

/**
 * 建造者模式-工程监理
 *
 * @author TPF
 * @since 2023/12/12
 */
public class Director {
    private Builder builder;

    public void setBuilder(Builder builder) {
        this.builder = builder;
    }

    /**
     * 控制施工流程
     */
    public Building direct() {
        System.out.println("=====工程项目启动=====");
        builder.buildBasement();
        builder.buildWall();
        builder.buildRoof();
        System.out.println("=====工程项目竣工=====");
        return builder.getBuilding();
    }
}
